<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<!-- Copyright 1997 The Open Group, All Rights Reserved -->
<title>localedef</title>
</head><body bgcolor=white>
<center>
<font size=2>
The Single UNIX &reg; Specification, Version 2<br>
Copyright &copy; 1997 The Open Group

</font></center><hr size=2 noshade>
<h4><a name = "tag_001_014_1194">&nbsp;</a>NAME</h4><blockquote>
localedef - define locale environment
</blockquote><h4><a name = "tag_001_014_1195">&nbsp;</a>SYNOPSIS</h4><blockquote>
<pre><code>

localedef <b>[</b>-c<b>][</b>-f <i>charmap</i><b>][</b>-i <i>sourcefile</i><b>]</b><i> name</i>
</code>
</pre>
</blockquote><h4><a name = "tag_001_014_1196">&nbsp;</a>DESCRIPTION</h4><blockquote>
The
<i>localedef</i>
utility converts source definitions for locale categories into a format
usable by the functions and utilities whose operational behaviour is
determined by the setting of the locale environment variables defined in
the <b>XBD</b> specification, <a href="../xbd/locale.html"><b>Locale</b>&nbsp;</a> .
It is implementation-dependent whether users have the
capability to create new locales, in addition to those supplied
by the implementation.
Since the symbolic constant
{POSIX2_LOCALEDEF}
is defined on all XSI-conformant systems,
the system supports the creation of new locales.
<p>
The utility reads source definitions for one or more locale categories
belonging to the same locale from the file named in the
<b>-i</b>
option (if specified) or from standard input.
<p>
The
<i>name</i>
operand identifies the target locale.
The utility supports the creation of
<i>public ,</i>
or generally accessible locales, as well as
<i>private ,</i>
or restricted-access locales.
Implementations may restrict the capability to create or modify
public locales to users with the appropriate privileges.
<p>
Each category source definition is identified by the corresponding
environment variable name and terminated by an
<b>END</b>
<i>category-name</i>
statement.
The following categories are supported.
In addition, the input may contain source for implementation-dependent
categories.
<dl compact>

<dt>LC_CTYPE<dd>
Defines character classification and case conversion.

<dt>LC_COLLATE<dd>
Defines collation rules.

<dt>LC_MONETARY<dd>
Defines the format and symbols used in formatting of monetary
information.

<dt>LC_NUMERIC<dd>
Defines the decimal delimiter, grouping and grouping symbol for
non-monetary numeric editing.

<dt>LC_TIME<dd>
Defines the format and content of date and time information.

<dt>LC_MESSAGES<dd>
Defines the format and values of affirmative and negative responses.

</dl>
</blockquote><h4><a name = "tag_001_014_1197">&nbsp;</a>OPTIONS</h4><blockquote>
The
<i>localedef</i>
utility supports the <b>XBD</b> specification, <a href="../xbd/utilconv.html#usg"><b>Utility Syntax Guidelines</b>&nbsp;</a> .
<p>
The following options are supported:
<dl compact>

<dt><b>-c&nbsp;</b>
<dd>
<dt><b>-c&nbsp;</b><i>(null)</i>
<dd>Create permanent output even if warning messages have been issued.

<dt><b>-f&nbsp;</b><i>charmap</i>
<dd>
Specify the pathname of a file
containing a mapping of character symbols and
collating element symbols to actual character encodings.
The format of the
<i>charmap</i>
is described under
the <b>XBD</b> specification, <a href="../xbd/charset.html#tag_001_004"><b>Character Set Description File</b>&nbsp;</a> .
This option must be specified if symbolic names (other than
collating symbols defined in a
<b>collating-symbol</b>
keyword) are used.
If the
<b>-f</b>
option is not present, an implementation-dependent
character mapping will be used.

<dt><b>-i&nbsp;</b><i>inputfile</i>
<dd>
The pathname of a file containing the source definitions.
If this option is not present, source definitions will be read from
standard input.
The format of the
<i>inputfile</i>
is described in
the <b>XBD</b> specification, <a href="../xbd/locale.html#tag_005_003"><b>Locale Definitions</b>&nbsp;</a> .

</dl>
</blockquote><h4><a name = "tag_001_014_1198">&nbsp;</a>OPERANDS</h4><blockquote>
The following operand is supported:
<dl compact>

<dt><i>name</i><dd>Identifies the locale.
See
the <b>XBD</b> specification, <a href="../xbd/locale.html"><b>Locale</b>&nbsp;</a> 
for a description of the use of this name.
If the name contains one or more slash characters,
<i>name</i>
will be interpreted as a pathname
where the created locale definitions will be stored.
If
<i>name</i>
does not contain any slash
characters, the interpretation of the name is
implementation-dependent
and the locale will be public.
This capability may be restricted to users with appropriate privileges.
(As a consequence of specifying one
<i>name</i>,
although several
categories can be processed in one execution, only categories belonging
to the same locale can be processed.)

</dl>
</blockquote><h4><a name = "tag_001_014_1199">&nbsp;</a>STDIN</h4><blockquote>
Unless the
<b>-i</b>
option is specified, the standard input
must be a text file containing one or more locale category source
definitions, as described in
the <b>XBD</b> specification, <a href="../xbd/locale.html#tag_005_003"><b>Locale Definitions</b>&nbsp;</a> .
When lines are continued using the escape character mechanism,
there is no limit to the length of the accumulated continued line.
</blockquote><h4><a name = "tag_001_014_1200">&nbsp;</a>INPUT FILES</h4><blockquote>
The character set mapping file
specified as the
<i>charmap</i>
option-argument is described under
the <b>XBD</b> specification, <a href="../xbd/charset.html#tag_001_004"><b>Character Set Description File</b>&nbsp;</a> .
If a locale category source definition contains a
<b>copy</b>
statement,
as defined in
the <b>XBD</b> specification, <a href="../xbd/locale.html"><b>Locale</b>&nbsp;</a> ,
and the
<b>copy</b>
statement names a valid, existing
locale, then
<i>localedef</i>
will behave as if the source definition
had contained a valid category source definition for the named locale.
</blockquote><h4><a name = "tag_001_014_1201">&nbsp;</a>ENVIRONMENT VARIABLES</h4><blockquote>
The following environment variables affect the execution of
<i>localedef</i>:
<dl compact>

<dt><i>LANG</i><dd>Provide a default value for the internationalisation variables
that are unset or null.
If
<i>LANG</i>
is unset or null, the corresponding value from the
implementation-dependent default locale will be used.
If any of the internationalisation variables contains an invalid setting, the
utility will behave as if none of the variables had been defined.

<dt><i>LC_ALL</i><dd>
If set to a non-empty string value,
override the values of all the other internationalisation variables.

<dt><i>LC_COLLATE</i><dd>
(This variable has no affect on
<i>localedef</i>;
the POSIX locale will be used for this category.)

<dt><i>LC_CTYPE</i><dd>
Determine the
locale for the interpretation of sequences of bytes of text data as
characters (for example, single- as opposed to multi-byte characters
in arguments and input files).
This variable has no affect on the processing of
<i>localedef</i>
input data;
the POSIX locale is used for this purpose,
regardless of the value of this variable.

<dt><i>LC_MESSAGES</i><dd>
Determine the locale that should be used to affect
the format and contents of diagnostic
messages written to standard error.

<dt><i>NLSPATH</i><dd>
Determine the location of message catalogues
for the processing of
<i>LC_MESSAGES .
</i>
</dl>
</blockquote><h4><a name = "tag_001_014_1202">&nbsp;</a>ASYNCHRONOUS EVENTS</h4><blockquote>
Default.
</blockquote><h4><a name = "tag_001_014_1203">&nbsp;</a>STDOUT</h4><blockquote>
The utility will report all categories successfully processed,
in an unspecified format.
</blockquote><h4><a name = "tag_001_014_1204">&nbsp;</a>STDERR</h4><blockquote>
Used only for diagnostic messages.
</blockquote><h4><a name = "tag_001_014_1205">&nbsp;</a>OUTPUT FILES</h4><blockquote>
The format of the created output is unspecified.
If the
<i>name</i>
operand does not contain a slash,
the existence of an output file for the locale is unspecified.
</blockquote><h4><a name = "tag_001_014_1206">&nbsp;</a>EXTENDED DESCRIPTION</h4><blockquote>
None.
</blockquote><h4><a name = "tag_001_014_1207">&nbsp;</a>EXIT STATUS</h4><blockquote>
The following exit values are returned:
<dl compact>

<dt>0<dd>No errors occurred and the locales were successfully created.

<dt>1<dd>Warnings occurred and the locales were successfully created.

<dt>2<dd>The locale specification exceeded implementation limits
or the coded character set or sets used were not supported
by the implementation, and no locale was created.

<dt>3<dd>The capability to create new locales is not supported by
the implementation.

<dt>&gt;3<dd>Warnings or errors occurred and no output was created.

</dl>
</blockquote><h4><a name = "tag_001_014_1208">&nbsp;</a>CONSEQUENCES OF ERRORS</h4><blockquote>
If an error is detected, no permanent output will be created.
<p>
If warnings occur, permanent output will be created if the
<b>-c</b>
option was specified.
The following conditions will cause warning messages
to be issued:
<ul>
<p>
<li>
If a symbolic name not found in the
<i>charmap</i>
file is used for the descriptions of the LC_CTYPE or LC_COLLATE
categories (for other categories, this will be an error condition).
<p>
<li>
If the number of operands to the
<b>order</b>
keyword exceeds the
{COLL_WEIGHTS_MAX}
limit.
<p>
<li>
If optional keywords not supported by the implementation
are present in the source.
<p>
</ul>
<p>
Other implementation-dependent conditions may also cause warnings.
</blockquote><h4><a name = "tag_001_014_1209">&nbsp;</a>APPLICATION USAGE</h4><blockquote>
The
<i>charmap</i>
definition is optional, and is contained outside the locale definition.
This allows both completely self-defined source
files, and generic sources (applicable to more than one codeset).
To aid portability, all
<i>charmap</i>
definitions must use the same symbolic names for the portable character set.
As explained in
the <b>XBD</b> specification, <a href="../xbd/charset.html#tag_001_004"><b>Character Set Description File</b>&nbsp;</a> ,
it is implementation-dependent whether or not users or applications can
provide additional character set description files.
Therefore, the
<b>-f</b>
option might be operable only when an implementation-dependent
<i>charmap</i>
is named.
</blockquote><h4><a name = "tag_001_014_1210">&nbsp;</a>EXAMPLES</h4><blockquote>
None.
</blockquote><h4><a name = "tag_001_014_1211">&nbsp;</a>FUTURE DIRECTIONS</h4><blockquote>
None.
</blockquote><h4><a name = "tag_001_014_1212">&nbsp;</a>SEE ALSO</h4><blockquote>
<i><a href="locale.html">locale</a></i>,
the <b>XBD</b> specification, <a href="../xbd/locale.html#tag_005_003"><b>Locale Definitions</b>&nbsp;</a> .
</blockquote><hr size=2 noshade>
<center><font size=2>
UNIX &reg; is a registered Trademark of The Open Group.<br>
Copyright &copy; 1997 The Open Group
<br> [ <a href="../index.html">Main Index</a> | <a href="../xshix.html">XSH</a> | <a href="../xcuix.html">XCU</a> | <a href="../xbdix.html">XBD</a> | <a href="../cursesix.html">XCURSES</a> | <a href="../xnsix.html">XNS</a> ]

</font></center><hr size=2 noshade>
</body></html>
